package numbers.strings;

public class StringBuilderLength {

	public static void main(String[] args) {
		StringBuilder sbBuilder = new StringBuilder();
		System.out.println("[" + sbBuilder + "] length:" + sbBuilder.length() + " capacity:" + sbBuilder.capacity());
		sbBuilder.append("abcdefgh");
		System.out.println("[" + sbBuilder + "] length:" + sbBuilder.length() + " capacity:" + sbBuilder.capacity());
		sbBuilder.insert(4," + ");
		System.out.println("[" + sbBuilder + "] length:" + sbBuilder.length() + " capacity:" + sbBuilder.capacity());
		sbBuilder.reverse();
		System.out.println("[" + sbBuilder + "] length:" + sbBuilder.length() + " capacity:" + sbBuilder.capacity());
		
		System.out.println("##################################");
		
		StringBuilder sb = new StringBuilder("abcdefgh");
		System.out.println("[" + sb + "] length:" + sb.length() + " capacity:" + sb.capacity());
		sb.setLength(6);
		System.out.println("[" + sb + "] length:" + sb.length() + " capacity:" + sb.capacity());
		sb.delete(0, 6);
		System.out.println("[" + sb + "] length:" + sb.length() + " capacity:" + sb.capacity());
	}
	
}
